using System;
using System.Data;
using System.Data.SqlClient;
using System.Collections.Generic;
using System.Text;
using Microsoft.ApplicationBlocks;
using BusinessRules;
using DataAccess;

namespace BusinessRules
{
    public class ReportesSinic
    {
        private const String VIG_ID_PARAM = "@VIG_ID";
        private const String POR_ANIO_PARAM = "@POR_ANIO";
        private const String PRO_ID_PARAM = "@PRO_ID";
        
        
        private string _CadenaConexion;

        public string CadenaConexion
        {
            get { return _CadenaConexion; }
            set { _CadenaConexion = value; }
        }

        public ReportesSinic(string strCadenaConecxion)
        {
            CadenaConexion = strCadenaConecxion;
        }

        public DataTable BuscarConcertacion(string strVigId)
        {
            DataTable objDataTable = new DataTable();
            SqlParameter param1 = new SqlParameter(VIG_ID_PARAM, strVigId);
            SqlParameter[] parameters = { param1 };
            Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataTable(CadenaConexion, CommandType.StoredProcedure, "PAS_BUSCAR_APP_PROYECTOS_HERNANDO_TOTALES", objDataTable, parameters);
            //Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataTable(CadenaConexion, CommandType.StoredProcedure, "PAS_BUSCAR_APP_PROYECTOS_HERNANDO", objDataTable, parameters);
            return objDataTable;
        }

        public DataTable BuscarConcertacionTotales(string strVigId,string strProId)
        {
            DataTable objDataTable = new DataTable();
            SqlParameter param1 = new SqlParameter(VIG_ID_PARAM, strVigId);
            SqlParameter param2 = new SqlParameter(PRO_ID_PARAM, strProId);
            SqlParameter[] parameters = { param1, param2 };
            Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataTable(CadenaConexion, CommandType.StoredProcedure, "PAS_BUSCAR_APP_PROYECTOS_HERNANDO_TOTALES", objDataTable, parameters);
            return objDataTable;
        }

        public DataTable BuscarEstimulosTotales1(string strPorAnio)
        {
            DataTable objDataTable = new DataTable();
            SqlParameter param1 = new SqlParameter(POR_ANIO_PARAM, strPorAnio);
            SqlParameter[] parameters = { param1 };
            Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataTable(CadenaConexion, CommandType.StoredProcedure, "PAS_BUSCAR_EST_INSCRIPCIONES_IVAN_1", objDataTable, parameters);
            return objDataTable;
        }

        public DataTable BuscarEstimulosTotales2(string strPorAnio)
        {
            DataTable objDataTable = new DataTable();
            SqlParameter param1 = new SqlParameter(POR_ANIO_PARAM, strPorAnio);
            SqlParameter[] parameters = { param1 };
            Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataTable(CadenaConexion, CommandType.StoredProcedure, "PAS_BUSCAR_EST_INSCRIPCIONES_IVAN_2", objDataTable, parameters);
            return objDataTable;
        }

        public DataTable BuscarEstimulosTotales3(string strPorAnio)
        {
            DataTable objDataTable = new DataTable();
            SqlParameter param1 = new SqlParameter(POR_ANIO_PARAM, strPorAnio);
            SqlParameter[] parameters = { param1 };
            Microsoft.ApplicationBlocks.Data.SqlHelper.ExecuteDataTable(CadenaConexion, CommandType.StoredProcedure, "PAS_BUSCAR_EST_INSCRIPCIONES_IVAN_3", objDataTable, parameters);
            return objDataTable;
        }
    }
}
